package com.hdax.dm.mappers;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hdax.dm.order.DmOrder;
import com.hdax.dm.order.DmOrderLinkUser;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface OrderMapper extends BaseMapper<DmOrder> {

    @Select(value = {
            "<script>",
            "SELECT * FROM dm_order_link_user",
            "<where>",
            "<if test=\"orderId!=-1\"> AND orderId=#{orderId}</if>",
            "</where>",
            "</script>"
    })
    List<DmOrderLinkUser> orderLink(Long orderId);
    @Update(value = {
            "UPDATE dm_order SET " ,
            "orderType = 1" ,
            "WHERE orderNo = #{orderNo}",
    })
    Boolean orderType(String OrderNo);

}
